package com.ygf;

import com.ygf.config.YgfConfig;
import com.ygf.listener.TestEvent;
import com.ygf.listener.TestEvent2;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * <p>
 * description:
 * </p>
 *
 * @author yangguanfeng
 * @since 2021/4/21 8:49
 */
public class TestSpringMain {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(YgfConfig.class);
		//CarService cs = context.getBean(CarService.class);
		//cs.test();
		TestEvent testEvent = new TestEvent("test");
		testEvent.setEventName("test1");
		context.publishEvent(testEvent);
		TestEvent2 testEvent2 = new TestEvent2();
		testEvent2.setEventName("test2");
		context.publishEvent(testEvent2);
	}
}
